<template>
  <div>
		<div class="header bgd_color">
			<div @click="goBack" class="left h_lf">

			</div>
			<div class="left h_center">
				我的账户
			</div>
      <router-link to="/withdrawals">
  			<div class="left h_rg f_color_white">
  				提现
  			</div>
      </router-link>
		</div>
		<div class="container bgd_color_gray">
			<div class="height260 text_center f_color_white bgd_color_a46f5f">
				<div class="f_size24 padding_t30">
					账户余额（元）
				</div>
				<div class="f_size50">
					{{myAccount.amount}}
				</div>

			</div>
			<div class="overflow_hide bgd_color_white margin_bot14">
        <router-link to="reward">
  				<div class="left width50 line_height94 text_center f_size22">
  					<img class="margin_rg10" src="../static/images/jiangli_icon.png" alt="" />
  					<span class="f_color_0">奖励明细</span>
  				</div>
        </router-link>
        <router-link to="balance">
  				<div class="left width50 line_height94 text_center f_size22">
  					<img class="margin_rg10" src="../static/images/yue_icon.png" alt="" />
  					<span class="f_color_0">余额明细</span>
  				</div>
        </router-link>
			</div>
			<div class="height142 bgd_color_white margin_bt4 pad_lr50">
				<div class="f_size26 padding_t20">
					本期奖励（元）
				</div>
				<div class="f_size26 f_color_main">
					{{monthlyTotal}}
				</div>
			</div>
			<div class="height142 bgd_color_white box_size_border pad_lr50 margin_bt4">
				<div class="f_size20 pad_t15">
					商品累计奖励（元）
				</div>
				<div class="overflow_hide text_center">
					<div class="left width33 f_size16">
						<div class="">
							{{myAccount.monthlyAmountSelf}}
						</div>
						<div class="f_color_gray0">
							销售奖励
						</div>
					</div>
					<div class="left width33 f_size16">
						<div class="">
							{{myAccount.monthlyAmountChild}}
						</div>
						<div class="f_color_gray0">
							团队奖励
						</div>
					</div>
					<div class="right width33 f_size16">
						<div class="">
							{{myAccount.bestMonthAmont}}
						</div>
						<div class="f_color_gray0">
							精英奖励
						</div>
					</div>
				</div>
			</div>
			<div class="height142 bgd_color_white pad_lr50 margin_bt20">
				<div class="f_size20 padding_t20">
					分红累计奖励（元）
				</div>
				<div class="f_size16">
					{{myAccount.directorAmount}}
				</div>
				<div class="f_color_gray0 f_size16">
					董事分红奖
				</div>
			</div>
			<div class="height142 bgd_color_white margin_bt4 pad_lr50">
				<div class="f_size26 padding_t20">
					店铺奖励券（元）
				</div>
				<div class="f_size26 f_color_main">
					{{myAccount.shopAmount}}
				</div>
			</div>
		</div>

  </div>
</template>
<script>
export default {
  created () {
    this.$api.get('/front/users', null, r => {
      console.log('我的账户r', r)
      this.myAccount = r.data.list[0]
      this.monthlyTotal = r.data.list[0].monthlyTotal
      console.log('this.myAccount', this.myAccount)
      if (this.myAccount === undefined) {
        this.myAccount = {
          remain: 0.00
        }
      }
    })
  },
  data () {
    return {
      myAccount: {},
      monthlyTotal: 0
    }
  },
  methods: {
    goBack: function () {
      this.$router.back(-1)
    }
  }
}
</script>

<style>
</style>
